package com.pricl.frame.shiro;

import java.util.HashMap;
import java.util.Map;

import org.apache.shiro.authz.SimpleAuthorizationInfo;

/**
 * <p>
 * 权限关系对应工具类
 * </p>
 *
 */
public class AuthorizationInfoHolder {

	private static Map<Long, SimpleAuthorizationInfo> infos = new HashMap<Long, SimpleAuthorizationInfo>();
//	private static Map<String, SimpleAuthorizationInfo> infos = new HashMap<String, SimpleAuthorizationInfo>();

	/**
	 * <p>
	 * </p>
	 * 
	 * @param key
	 * @return
	 */
	public static SimpleAuthorizationInfo get(Long key) {
		return infos.get(key);
	}

	/**
	 * <p>
	 * </p>
	 * 
	 * @param key
	 * @param obj
	 * @return
	 */
	public static SimpleAuthorizationInfo put(Long key, SimpleAuthorizationInfo obj) {
		return infos.put(key, obj);
	}

	/**
	 * <p>
	 * </p>
	 * 
	 * @param key
	 * @return
	 */
	public static SimpleAuthorizationInfo remove(Long key) {
		return infos.remove(key);
	}

	/**
	 * <p>
	 * </p>
	 */
	public static void removeAll() {
		infos.clear();
	}
}
